using ClassDemo.Model.Entity;


namespace ClassDemo.Repository;

/// <summary>
/// 学生Repository接口
/// </summary>
public interface IStudentRepository : IBaseRepository<Student>
{
    /// <summary>
    /// 根据学号查询学生
    /// </summary>
    /// <param name="studentNo">学号</param>
    /// <returns>学生信息</returns>
    Task<Student?> GetByStudentNoAsync(string studentNo);

    /// <summary>
    /// 根据班级查询学生列表
    /// </summary>
    /// <param name="className">班级名称</param>
    /// <returns>学生列表</returns>
    Task<List<Student>> GetByClassAsync(string className);

    /// <summary>
    /// 根据专业查询学生列表
    /// </summary>
    /// <param name="major">专业</param>
    /// <returns>学生列表</returns>
    Task<List<Student>> GetByMajorAsync(string major);

    /// <summary>
    /// 根据年级查询学生列表
    /// </summary>
    /// <param name="grade">年级</param>
    /// <returns>学生列表</returns>
    Task<List<Student>> GetByGradeAsync(string grade);

    /// <summary>
    /// 根据手机号查询学生
    /// </summary>
    /// <param name="mobile">手机号</param>
    /// <returns>学生信息</returns>
    Task<Student?> GetByMobileAsync(string mobile);

    /// <summary>
    /// 根据学号或手机号查询学生（用于登录）
    /// </summary>
    /// <param name="account">学号或手机号</param>
    /// <returns>学生信息</returns>
    Task<Student?> GetByAccountAsync(string account);

    /// <summary>
    /// 检查学号是否已存在
    /// </summary>
    /// <param name="studentNo">学号</param>
    /// <param name="excludeId">排除的学生ID（用于更新时检查）</param>
    /// <returns>是否存在</returns>
    Task<bool> IsStudentNoExistsAsync(string studentNo, int? excludeId = null);

    /// <summary>
    /// 检查手机号是否已存在
    /// </summary>
    /// <param name="mobile">手机号</param>
    /// <param name="excludeId">排除的学生ID（用于更新时检查）</param>
    /// <returns>是否存在</returns>
    Task<bool> IsMobileExistsAsync(string mobile, int? excludeId = null);
}